function receive() {
    var receive = document.getElementById("Have_receive");
    var defcolor = document.getElementsByClassName("defcolor")[0];
    console.log(defcolor);
    receive.onclick = function () {   
        defcolor.style.backgroundColor ="#a3a3a3";
        defcolor.innerHTML="已领取";
    }
}
receive()